home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Applications 1996 May / SGI IRIX 6.2 Applications 1996 May.iso / dist / patchSG0001135.idb / usr / bin / adobeChkLicense.z / adobeChkLicense
Encoding:
Text File  |  1996-05-07  |  1.0 KB  |  57 lines

  1. #!/bin/sh
  2.  
  3. # Make sure the argument count is correct
  4. if [ $# != 1 ] ; then
  5.     echo Usage: chkLicese execuatableName
  6.     exit 1
  7. fi
  8.  
  9. cd /tmp
  10. LS=/usr/bin/ls
  11.  
  12. ADOBE_LICENSE_DIR=/usr/adobe/AdobeLicense
  13. export ADOBE_LICENSE_DIR
  14. adobeApp=$1
  15. # retrieve path name of this executable
  16. executable=`which $1`
  17.  
  18.  
  19. if [ $? = 0 ] ; then
  20.     longlist=`$LS -l $executable`
  21.     test -l $executable
  22.     if [ $? = 0 ] ; then
  23.         abspath=`$LS -l $executable | awk '/bin/ { print $11 }'`
  24.     else
  25.         abspath=$executable
  26.     fi
  27.  
  28.     scriptdir=`expr $abspath : '\(.*\)/'`
  29.  
  30.     num=`expr $scriptdir : ".*/bin"`
  31.  
  32.     if [ "$num" -gt 0 ] ; then
  33.         binpath=`expr $scriptdir : '.*/\(.*\)/bin'`
  34.     else
  35.         binpath=`expr $scriptdir : '.*/\(.*\)'`
  36.     fi
  37.  
  38.     numchar=`expr $adobeApp : ".*"`
  39.  
  40.     i=1
  41.     ver=$binpath
  42.     while [ "$i" -le "$numchar" ]
  43.     do
  44.         ver=`echo $ver | sed 's/.//'`
  45.         i=`expr $i + 1`
  46.     done
  47.  
  48.  
  49. #       invoke adobeLicense to verify that the user has
  50. #       accepted the license agreement stuff
  51.     adobeLicense $adobeApp $ver
  52.  
  53. else
  54. #       This executable is not existed in the system
  55.     echo "No such executable: "$1" on the system"
  56. fi
  57.